<?php

namespace Myth\Data\Model\Mapper\Decorator;

use Myth\Data\Model\Mapper;
use Myth\Data;

class Pagination
{
    /**
     * @var Myth\Data\Model\Mapper\IMapper
     */
    protected $_mapper;
    
    public function __construct(IMapper $mapper)
    {
        $this->_mapper = $mapper;
    }
    
    /**
     * @param Myth\Data\Pagination $paginator
     * @param $where
     * @param $order
     */
    public function find(Myth\Data\Pagination $pagination, $where = null, $order = null)
    {
        //TODO: calculate count & offset
        $page = $pagination->getPage();
        $count = 0;
        $offset = 0;
        //TODO: fix where clause
        
        return $this->_mapper->find($where, $order, $count, $offset);
    }
}